package com.swind.fast.modules.app.railway.project.constant;

import com.swind.fast.common.util.oConvertUtils;

/**
 * Query 规则 常量
 */
public enum ProjectTestMethodsEnum {

    SINGLE(1, "静力触探-单桥", "静力触探-单桥"),
    DOUBLE(2, "静力触探-双桥", "静力触探-双桥"),
    HOLE(3, "静力触探-孔压", "静力触探-孔压");

    private Integer value;
    private String name;
    private String msg;

    ProjectTestMethodsEnum(Integer value, String name, String msg) {
        this.value = value;
        this.name = name;
        this.msg = msg;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static ProjectTestMethodsEnum getByValue(String value){
        Integer ivalue = oConvertUtils.getInt(value);
        if (ivalue == 0) {
            return null;
        }
        for (ProjectTestMethodsEnum val :values()){
            if (val.getValue().equals(ivalue) || val.getName().equals(value)){
                return val;
            }
        }
        return null;
    }

    public static ProjectTestMethodsEnum getByName(String name){
        if (oConvertUtils.isEmpty(name)) {
            return null;
        }
        for (ProjectTestMethodsEnum val :values()) {
            if (val.getName().equals(name)) {
                return val;
            }
        }
        return null;
    }
}
